﻿var banner0 = '<a href="http://me.zing.vn/apps/blog?params=game.ntvv2/blog/detail/id/341789735" title="" target="_blank"><img src="http://movie.zing.vn/Movie/images/adv/ntvv2b_728x90.gif" border="0" alt="" /></a>';
//var banner0 = '<div style="position: relative"><div style="position: absolute; width: 728px; 90px; z-index: 1; cursor: pointer;"><a href="http://mp3.zing.vn/mp3/zing-album/index.html" style="display: block" target="_blank"><div style="width: 728px; height: 90px; -moz-opacity: 0; filter: alpha(opacity=0); background-color: #FFFFFF; cursor: pointer;"></div></a></div><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="728" height="90"><param name="movie" value="http://movie.zing.vn/Movie/images/adv/zingmp3.swf" /><param name="wmode" value="transparent" /><param name="quality" value="high" /><embed wmode="transparent" src="http://movie.zing.vn/Movie/images/adv/zingmp3.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="728" height="90"></embed></object></div>';
var BannerAds = new Array(banner0);
var DisplayInterval = 20; //Number of seconds to wait before the next image is displayed

//Internal variables (do not change these unless you know what you are doing)
var IsValidBrowser = false;
var BannerAdCode = 0;
var DisplayInterval = DisplayInterval * 1000;
var NumberOfImages = BannerAds.length;

//Function runs when this page has been loaded and does the following:
//1. Determine the browser name and version
// (since the script will only work on Netscape 3+ and Internet Explorer 4+).
//2. Start the timer object that will periodically change the image displayed
// by the Banner Ad.
//3. Preload the images used by the Banner Ad rotator script
function InitialiseBannerAdRotator() {

    //Determine the browser name and version
    //The script will only work on Netscape 3+ and Internet Explorer 4+
    var BrowserType = navigator.appName;
    var BrowserVersion = parseInt(navigator.appVersion);

    if (BrowserType == "Netscape" && (BrowserVersion >= 3)) {
        IsValidBrowser = true;
    }

    if (BrowserType == "Microsoft Internet Explorer" && (BrowserVersion >= 4)) {
        IsValidBrowser = true;
    }

    if (IsValidBrowser) {
        TimerObject = setTimeout("ChangeAdImage()", DisplayInterval);
        BannerAdCode = 0;
    }
}

//Function to change the src of the Banner Ad image
function ChangeAdImage() {

    if (IsValidBrowser) {
        BannerAdCode = BannerAdCode + 1;
        if (BannerAdCode == NumberOfImages) {
            BannerAdCode = 0;
        }
        document.getElementById("BannerAds").innerHTML = BannerAds[BannerAdCode];
        TimerObject = setTimeout("ChangeAdImage()", DisplayInterval);
    }
}